Page({
  data: {
    isLike: true,
    // banner
    indicatorDots: true, //是否显示面板指示点
    autoplay: true, //是否自动切换
    interval: 3000, //自动切换时间间隔,3s
    duration: 1000,//	滑动动画时长1s
    imgUrls: [
      'https://img10.360buyimg.com/n1/s350x467_jfs/t1/69387/38/27614/69858/653a4817Fbf775f91/c00527b99d1ac936.jpg!cc_350x467.avif',
      'https://img10.360buyimg.com/n1/s350x467_jfs/t1/179165/32/41611/83342/653a4815F3f7c4c34/6c09d6936e25b6a3.jpg!cc_350x467.avif',
      'https://img10.360buyimg.com/n1/s350x467_jfs/t1/135258/2/40225/73117/653a4814F1b888ba0/e9df70e2f6eab9c4.jpg!cc_350x467.avif',
      'https://img10.360buyimg.com/n1/s350x467_jfs/t1/180696/19/40224/94139/653a4813Fe2b63647/4765a742c509a67c.jpg!cc_350x467.avif',
      'https://img10.360buyimg.com/n1/s350x467_jfs/t1/132046/8/40577/46283/653a4816F32fa47d0/4aab8b07c0380c90.jpg!cc_350x467.avif'

    ],


    // 商品详情介绍
    detailImg: [
 "http://img30.360buyimg.com/popWareDetail/jfs/t1/191509/38/39966/43459/653a4897F242cb1fd/5d8f04a365dec3de.jpg",
"http://img30.360buyimg.com/popWareDetail/jfs/t1/178868/38/41699/90959/653a489dFf753ab78/51a901b4cecc4c77.jpg",
"https://img10.360buyimg.com/imgzone/jfs/t1/183173/1/41287/23433/653a48a7F398ade4d/1c71f75b600aec3c.jpg",
 "https://img10.360buyimg.com/imgzone/jfs/t1/8706/17/24596/141414/653a48a8Fe801984d/5068b2342bddc1be.jpg",

 "https://img10.360buyimg.com/imgzone/jfs/t1/138153/21/8798/106631/5f66b89fE31baabe6/4d45bb1d2ee6a1d2.jpg",

     
    ],
  },
  //预览图片
  onLoad() {
    console.log(this.data.imgUrls); // 检查数据是否正常
  },
  previewImage(e) {
    wx.previewImage({
      current: e.currentTarget.dataset.src,
      urls: this.data.imgUrls

    })
  },
  // 收藏
  addLike() {
    this.setData({
      isLike: !this.data.isLike
    });
  },
  // 跳到购物车
  toCar() {
    wx.switchTab({
      url: '/pages/cart/cart'
    })
  },
  // 立即购买
  immeBuy() {
    wx.showToast({
      title: '购买成功',
      icon: 'success',
      duration: 2000
    });
  },
})
